package com.atguigu.day31.forword01;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/12/10 9:38
 * @注释
 */
@WebServlet("/ServletA")
public class ServletA extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("ServletA 请求送达了");


        req.getRequestDispatcher("ServletB").forward(req, resp);

        resp.getWriter().println("ServletA Success");

    }
}
